package ua.pp.pycb6a.tranggui;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

public class TrangGui extends Application {

    private static final String ICON = "/images/icon.png";

    private static final String TITLE = "trang-gui";

    private static final String STYLES = "/styles/styles.css";

    private static final int HEIGHT = 600;

    private static final int WIDTH = 800;

    private static final String FXML = "/fxml/Frame.fxml";

    public static void main(String[] args) throws Exception {
        launch(args);
    }

    public void start(Stage stage) throws Exception {
        String fxmlFile = FXML;
        FXMLLoader loader = new FXMLLoader();
        Parent rootNode = (Parent) loader.load(getClass().getResourceAsStream(fxmlFile));
        Scene scene = new Scene(rootNode, WIDTH, HEIGHT);
        scene.getStylesheets().add(STYLES);
        stage.setTitle(TITLE);
        stage.getIcons().add(new Image(getClass().getResourceAsStream(ICON)));
        stage.setScene(scene);
        stage.show();
    }
}
